package com.mouliu.base.concurrent17;

/**
 * @author mouliu
 * @create 2018-04-15-上午12:36
 */
public class MyTask  implements Runnable{
    private int taskId;
    private String taskName;

    public MyTask(int taskId,String taskName){
        this.taskId = taskId;
        this.taskName = taskName;
    }

    public int getTaskId() {
        return taskId;
    }

    public void setTaskId(int taskId) {
        this.taskId = taskId;
    }

    public String getTaskName() {
        return taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    @Override
    public void run() {
        try {
            System.out.println("run tasId="+this.taskId);
            Thread.sleep(5*1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

    @Override
    public  String toString(){
        return  Integer.toString(this.taskId);
    }
}
